import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/duty/month_duty_date_entity.dart';

MonthDutyDateEntity $MonthDutyDateEntityFromJson(Map<String, dynamic> json) {
  final MonthDutyDateEntity monthDutyDateEntity = MonthDutyDateEntity();
  final String? count = jsonConvert.convert<String>(json['count']);
  if (count != null) {
    monthDutyDateEntity.count = count;
  }
  final String? dutyDate = jsonConvert.convert<String>(json['dutyDate']);
  if (dutyDate != null) {
    monthDutyDateEntity.dutyDate = dutyDate;
  }
  final String? dutyPersons = jsonConvert.convert<String>(json['dutyPersons']);
  if (dutyPersons != null) {
    monthDutyDateEntity.dutyPersons = dutyPersons;
  }
  final String? dutyLeaders = jsonConvert.convert<String>(json['dutyLeaders']);
  if (dutyLeaders != null) {
    monthDutyDateEntity.dutyLeaders = dutyLeaders;
  }
  return monthDutyDateEntity;
}

Map<String, dynamic> $MonthDutyDateEntityToJson(MonthDutyDateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['count'] = entity.count;
  data['dutyDate'] = entity.dutyDate;
  data['dutyPersons'] = entity.dutyPersons;
  data['dutyLeaders'] = entity.dutyLeaders;
  return data;
}

extension MonthDutyDateEntityExtension on MonthDutyDateEntity {
  MonthDutyDateEntity copyWith({
    String? count,
    String? dutyDate,
    String? dutyPersons,
    String? dutyLeaders,
  }) {
    return MonthDutyDateEntity()
      ..count = count ?? this.count
      ..dutyDate = dutyDate ?? this.dutyDate
      ..dutyPersons = dutyPersons ?? this.dutyPersons
      ..dutyLeaders = dutyLeaders ?? this.dutyLeaders;
  }
}